Split Order Functionality
What is split order?
A split order occurs when a single order cannot be fulfilled by a single vendor and is divided into multiple child orders. Below are some scenarios to illustrate this:
Scenario 1:\ A user orders two SKUs---Boost Chocolate Powder and Telma 40 tablets. If the allocated vendor can only fulfill the Telma tablets and not the Boost Powder, the order will be split into two child orders. One child order will contain the Telma tablets, while another will contain the Boost Powder, which will be assigned to a different vendor.
Scenario 2:\ A user orders 10 ENO sachets, but the vendor can only supply 6 sachets. The remaining 4 sachets will be assigned to another vendor, splitting the order into two child orders: one for 6 sachets and the other for 4.
NOTE: Orders can only be split before packaging (shipping label generation), unless a SKU or quantity is revised due to return and refund.
How does the order ID look after splitting?
- Before split: order_id: O1
- After split: O1, O2,...
The first child order's ID will be the same as the group order ID, and subsequent child orders will have new order IDs. When an order is split, it's crucial to identify the split orders in the order webhook.
Scenarios of Split and Non-Split Orders in Webhook Payloads
Scenario 1:\ The following is an example webhook received by merchants:
{
"payload": {
...
"grouped_orders": [
{
...
"order_id": "PO06423290890328",
...
"skus": [
{
"name": "Boost Powder Malt",
...
},
{
"name": "Eno Powder Lemon",
...
}
],
...
}
]
},
"merchant_id": "HEALTH_ASSURE"
}
In this example, the user ordered two SKUs: Boost Powder and Eno Powder. The order was not split, and it is being fulfilled by a single vendor, so the merchant will receive the webhook as shown above.
Each order has a group_order_id
(parent ID). In non-split orders, the group_order_id
is the same as the order_id
, which can be observed in the webhook payload.
The grouped_orders
key is an array. Since this order is not split, the array contains only one object, representing the order ID for all SKUs and their details.
Scenario 2:\ Assume the order is delivered, and the merchant receives a delivery webhook update. Later, the user requests a return for the Boost Powder. The merchant will receive the following webhook:
{
"payload": {
...
"grouped_orders": [
{
...
"order_id": "PO06423290890328",
...
},
{
...
"order_id": "PO06423293942945",
...
}
]
},
"merchant_id": "HEALTH_ASSURE"
}
Now, the order is split into two child orders. Notice that the grouped_orders
array now contains two objects, each representing a child order. The first object shows the order status as "delivered," while the second shows the status as "return requested." The merchant can identify and track status changes for each child order.
NOTE: For every webhook received, merchants should check the
grouped_orders
key to determine if the order was split. Tata 1mg will continue to trigger webhook payloads for any status changes for child orders, which the merchant will need to track separately.